import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./en.json";
import cn from "./cn.json";
import useLanguageStore from "../store/language";

const lang = useLanguageStore.getState().curLanguage;

i18n.use(initReactI18next).init({
  resources: {
    en: {
      translation: en,
    },
    zh: {
      translation: cn,
    },
  },
  lng: lang.locale,
});
export default i18n;